package lib;

import java.io.Serializable;

public class Message implements Serializable{
	private ActorAddress source;
	private String srcActorType;
	private String destActorType;
	private String operation;
	private Serializable content;
	private String superActorOperation;

	public Message(ActorAddress source, String srcActorType, String destActorType, String operation, Serializable content){
		this.source=source.clone();
		this.srcActorType=srcActorType;
		this.destActorType=destActorType;
		this.operation=operation;
		this.content=content;
		this.superActorOperation = new String();
	}

	public Message(ActorAddress source, String srcActorType, String destActorType, String operation, String superActorOperation, Serializable content){
		this.source=source.clone();
		this.srcActorType=srcActorType;
		this.destActorType=destActorType;
		this.operation=operation;
		this.content=content;
		this.superActorOperation = superActorOperation;
	}

	public String toString(){
		return "Source Actor Address: "+this.source.toString()+"\n"
		      +"Source Actor Type: "+this.srcActorType+"\n"
		      +"Destination Actor Type: "+this.destActorType+"\n"
		      +"Message Operation: "+this.operation+"\n"
		      +"Message Content: "+this.content+"\n";
	}
	public ActorAddress getSrcAddress(){
		return this.source.clone();
	}
	public String getSrcActorType(){
		return this.srcActorType;
	}
	public String getDestActorType(){
		return this.destActorType;
	}
	public String getOperation(){
		return this.operation;
	}
	public Serializable getContent(){
		return this.content;
	}
	public String getSuperActorOperation() {
		return this.superActorOperation;
	}
}
